<?php
  INCLUDE "F_CONX.php";

  $V_ANIO     = $HTTP_POST_VARS["V_ANIO"];
  $V_MES      = $HTTP_POST_VARS["V_MES"];
  $V_REPORTE  = $HTTP_POST_VARS["V_REPORTE"];
  $V_EDO      = $HTTP_POST_VARS["V_EDO"];
  $V_MODIF    = $HTTP_POST_VARS["V_MODIF"];

  $V_USU1     = $HTTP_POST_VARS["V_USU1"];
  $V_USU1a    = $HTTP_POST_VARS["V_USU1a"];
  $V_USU1b    = $HTTP_POST_VARS["V_USU1b"];
  $V_USU1c    = $HTTP_POST_VARS["V_USU1c"];
  $V_USU1d    = $HTTP_POST_VARS["V_USU1d"];
  $V_USU1e    = $HTTP_POST_VARS["V_USU1e"];
  $V_USU1f    = $HTTP_POST_VARS["V_USU1f"];
  $V_USUDAC   = $HTTP_POST_VARS["V_USUDAC"];
  $V_USU2     = $HTTP_POST_VARS["V_USU2"];
  $V_USU3     = $HTTP_POST_VARS["V_USU3"];
  $V_USU5     = $HTTP_POST_VARS["V_USU5"];
  $V_USU5a    = $HTTP_POST_VARS["V_USU5a"];
  $V_USU6     = $HTTP_POST_VARS["V_USU6"];
  $V_USU7     = $HTTP_POST_VARS["V_USU7"];
  $V_USU9     = $HTTP_POST_VARS["V_USU9"];
  $V_USU9M    = $HTTP_POST_VARS["V_USU9M"];
  $V_USU9CU   = $HTTP_POST_VARS["V_USU9CU"];
  $V_USU9N    = $HTTP_POST_VARS["V_USU9N"];
  $V_USUOM    = $HTTP_POST_VARS["V_USUOM"];
  $V_USUHM    = $HTTP_POST_VARS["V_USUHM"];
  $V_USUH_MC  = $HTTP_POST_VARS["V_USUHMC"];
  $V_USUHS    = $HTTP_POST_VARS["V_USUHS"];
  $V_USUH_SL  = $HTTP_POST_VARS["V_USUHSL"];
  $V_USUHT    = $HTTP_POST_VARS["V_USUHT"];
  $V_USUH_TL  = $HTTP_POST_VARS["V_USUHTL"];

  $V_VTA1     = $HTTP_POST_VARS["V_VTA1"];
  $V_VTA1a    = $HTTP_POST_VARS["V_VTA1a"];
  $V_VTA1b    = $HTTP_POST_VARS["V_VTA1b"];
  $V_VTA1c    = $HTTP_POST_VARS["V_VTA1c"];
  $V_VTA1d    = $HTTP_POST_VARS["V_VTA1d"];
  $V_VTA1e    = $HTTP_POST_VARS["V_VTA1e"];
  $V_VTA1f    = $HTTP_POST_VARS["V_VTA1f"];
  $V_VTADAC   = $HTTP_POST_VARS["V_VTADAC"];
  $V_VTA2     = $HTTP_POST_VARS["V_VTA2"];
  $V_VTA3     = $HTTP_POST_VARS["V_VTA3"];
  $V_VTA5     = $HTTP_POST_VARS["V_VTA5"];
  $V_VTA5a    = $HTTP_POST_VARS["V_VTA5a"];
  $V_VTA6     = $HTTP_POST_VARS["V_VTA6"];
  $V_VTA7     = $HTTP_POST_VARS["V_VTA7"];
  $V_VTA9     = $HTTP_POST_VARS["V_VTA9"];
  $V_VTA9M    = $HTTP_POST_VARS["V_VTA9M"];
  $V_VTA9CU   = $HTTP_POST_VARS["V_VTA9CU"];
  $V_VTA9N    = $HTTP_POST_VARS["V_VTA9N"];
  $V_VTAOM    = $HTTP_POST_VARS["V_VTAOM"];
  $V_VTAHM    = $HTTP_POST_VARS["V_VTAHM"];
  $V_VTAH_MC  = $HTTP_POST_VARS["V_VTAHMC"];
  $V_VTAHS    = $HTTP_POST_VARS["V_VTAHS"];
  $V_VTAH_SL  = $HTTP_POST_VARS["V_VTAHSL"];
  $V_VTAHT    = $HTTP_POST_VARS["V_VTAHT"];
  $V_VTAH_TL  = $HTTP_POST_VARS["V_VTAHTL"];

  $V_PRO1     = $HTTP_POST_VARS["V_PRO1"];
  $V_PRO1a    = $HTTP_POST_VARS["V_PRO1a"];
  $V_PRO1b    = $HTTP_POST_VARS["V_PRO1b"];
  $V_PRO1c    = $HTTP_POST_VARS["V_PRO1c"];
  $V_PRO1d    = $HTTP_POST_VARS["V_PRO1d"];
  $V_PRO1e    = $HTTP_POST_VARS["V_PRO1e"];
  $V_PRO1f    = $HTTP_POST_VARS["V_PRO1f"];
  $V_PRODAC   = $HTTP_POST_VARS["V_PRODAC"];
  $V_PRO2     = $HTTP_POST_VARS["V_PRO2"];
  $V_PRO3     = $HTTP_POST_VARS["V_PRO3"];
  $V_PRO5     = $HTTP_POST_VARS["V_PRO5"];
  $V_PRO5a    = $HTTP_POST_VARS["V_PRO5a"];
  $V_PRO6     = $HTTP_POST_VARS["V_PRO6"];
  $V_PRO7     = $HTTP_POST_VARS["V_PRO7"];
  $V_PRO9     = $HTTP_POST_VARS["V_PRO9"];
  $V_PRO9M    = $HTTP_POST_VARS["V_PRO9M"];
  $V_PRO9CU   = $HTTP_POST_VARS["V_PRO9CU"];
  $V_PRO9N    = $HTTP_POST_VARS["V_PRO9N"];
  $V_PROOM    = $HTTP_POST_VARS["V_PROOM"];
  $V_PROHM    = $HTTP_POST_VARS["V_PROHM"];
  $V_PROH_MC  = $HTTP_POST_VARS["V_PROHMC"];
  $V_PROHS    = $HTTP_POST_VARS["V_PROHS"];
  $V_PROH_SL  = $HTTP_POST_VARS["V_PROHSL"];
  $V_PROHT    = $HTTP_POST_VARS["V_PROHT"];
  $V_PROH_TL  = $HTTP_POST_VARS["V_PROHTL"];

/*  SWITCH ($V_REPORTE)
  {
     CASE "CEDOVE" : { $V_EDO=$V_ZONA; $V_ZONA=STRTOUPPER($G_DIVISION); } BREAK;
     CASE "CAVEZO" : $V_EDO="O"; BREAK;
  }
*/

/*IF ($V_MODIF==1)
{
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1',VTA='$V_VTA1',PRO='$V_PRO1' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1'";
  ECHO $MS_SQL;
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1a',VTA='$V_VTA1a',PRO='$V_PRO1a' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1a'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1b',VTA='$V_VTA1b',PRO='$V_PRO1b' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1b'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1c',VTA='$V_VTA1c',PRO='$V_PRO1c' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1c'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1d',VTA='$V_VTA1d',PRO='$V_PRO1d' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1d'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1e',VTA='$V_VTA1e',PRO='$V_PRO1e' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1e'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU1f',VTA='$V_VTA1f',PRO='$V_PRO1f' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='1f'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUDAC',VTA='$V_VTADAC',PRO='$V_PRODAC' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='DAC'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU2',VTA='$V_VTA2',PRO='$V_PRO2' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='2'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU3',VTA='$V_VTA3',PRO='$V_PRO3' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='3'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU5',VTA='$V_VTA5',PRO='$V_PRO5' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='5'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU5a',VTA='$V_VTA5a',PRO='$V_PRO5a' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='5a'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU6',VTA='$V_VTA6',PRO='$V_PRO6' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='6'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU7',VTA='$V_VTA7',PRO='$V_PRO7' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='7'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU9',VTA='$V_VTA9',PRO='$V_PRO9' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='9'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU9M',VTA='$V_VTA9M',PRO='$V_PRO9M' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='9M'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU9CU',VTA='$V_VTA9CU',PRO='$V_PRO9CU' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='9CU'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USU9N',VTA='$V_VTA9N',PRO='$V_PRO9N' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='9N'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUOM',VTA='$V_VTAOM',PRO='$V_PROOM' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='OM'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUHM',VTA='$V_VTAHM',PRO='$V_PROHM' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='HM'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUH_MC',VTA='$V_VTAH_MC',PRO='$V_PROH_MC' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='H_MC'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUHS',VTA='$V_VTAHS',PRO='$V_PROHS' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='HS'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUH_SL',VTA='$V_VTAH_SL',PRO='$V_PROH_SL' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='H_SL'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUHT',VTA='$V_VTAHT',PRO='$V_PROHT' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='HT'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "UPDATE datos SET USU='$V_USUH_TL',VTA='$V_VTAH_TL',PRO='$V_PROH_TL' WHERE ZONA='$V_ZONA' AND MES='$V_MES' AND ANIO='$V_ANIO' AND EDO='$V_EDO' AND TAR='H_TL'";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
}
ELSE
{ */

  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','01','$V_EDO','$V_USU1','$V_VTA1','$V_PRO1')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1a','$V_EDO','$V_USU1a','$V_VTA1a','$V_PRO1a')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1b','$V_EDO','$V_USU1b','$V_VTA1b','$V_PRO1b')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1c','$V_EDO','$V_USU1c','$V_VTA1c','$V_PRO1c')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1d','$V_EDO','$V_USU1d','$V_VTA1d','$V_PRO1d')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1e','$V_EDO','$V_USU1e','$V_VTA1e','$V_PRO1e')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','1f','$V_EDO','$V_USU1f','$V_VTA1f','$V_PRO1f')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','DAC','$V_EDO','$V_USUDAC','$V_VTADAC','$V_PRODAC')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','02','$V_EDO','$V_USU2','$V_VTA2','$V_PRO2')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','03','$V_EDO','$V_USU3','$V_VTA3','$V_PRO3')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','05','$V_EDO','$V_USU5','$V_VTA5','$V_PRO5')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','5a','$V_EDO','$V_USU5a','$V_VTA5a','$V_PRO5a')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','06','$V_EDO','$V_USU6','$V_VTA6','$V_PRO6')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','07','$V_EDO','$V_USU7','$V_VTA7','$V_PRO7')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','09','$V_EDO','$V_USU9','$V_VTA9','$V_PRO9')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','9M','$V_EDO','$V_USU9M','$V_VTA9M','$V_PRO9M')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','9CU','$V_EDO','$V_USU9CU','$V_VTA9CU','$V_PRO9CU')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','9N','$V_EDO','$V_USU9N','$V_VTA9N','$V_PRO9N')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','OM','$V_EDO','$V_USUOM','$V_VTAOM','$V_PROOM')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HM','$V_EDO','$V_USUHM','$V_VTAHM','$V_PROHM')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HMC','$V_EDO','$V_USUH_MC','$V_VTAH_MC','$V_PROH_MC')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HS','$V_EDO','$V_USUHS','$V_VTAHS','$V_PROHS')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HSL','$V_EDO','$V_USUH_SL','$V_VTAH_SL','$V_PROH_SL')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HT','$V_EDO','$V_USUHT','$V_VTAHT','$V_PROHT')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);
  $MS_SQL     = "INSERT INTO datos VALUES ('$V_ZONA','$V_MES','$V_ANIO','HTL','$V_EDO','$V_USUH_TL','$V_VTAH_TL','$V_PROH_TL')";
  $MS_RESULT  = MYSQL_QUERY($MS_SQL);

//}
?>
